package com.zy.mq.listener;

import org.springframework.jms.listener.SessionAwareMessageListener;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.Session;
import javax.jms.TextMessage;

public class MQMessageListener implements SessionAwareMessageListener{

    @Override
    public void onMessage(Message message, Session session) throws JMSException {
       if(message instanceof TextMessage){
           TextMessage textMessage = (TextMessage) message;
           System.err.println("接收到消息："+textMessage);
       }
    }
}
